//83.删除排序链表中的重复元素
//https://leetcode.cn/problems/remove-duplicates-from-sorted-list/
class Solution {
public:
    ListNode* deleteDuplicates(ListNode* head) {
        if(!head) return head;
        ListNode* cur = head;
        for(ListNode* i = head->next;i;i=i->next)
        {
            if(i->val != cur->val)
            {
                cur->next = i;
                cur = i;
            }
        }
        cur->next = nullptr;
        return head;
    }
};